<template>
    <div>
        <p> i  am  son</p>
        <h1>i am son</h1>
        <el-button @click="loading=!loading">loading?</el-button>
        <el-button @click="$message('hello ')">message</el-button>
        <el-container  v-loading="loading">
            <el-header style="background-color: #B3C0D1">header</el-header>
            <el-aside style="background-color: red">
                s
            </el-aside>
            <el-container>
                <el-aside style="background-color: #B3C0D1">
                    <el-button-group>
                        <el-button class="el-icon-lollipop">123</el-button>
                        <el-button class="el-icon-share"></el-button>
                        <el-button class="el-icon-delete"></el-button>
                        <el-button type="primary" icon="el-icon-search">搜索</el-button>
                    </el-button-group>
                    <el-radio-group v-model="radio">
                        <el-radio :label="3">备选项</el-radio>
                        <el-radio :label="6">备选项</el-radio>
                        <el-radio :label="9">备选项</el-radio>
                    </el-radio-group>

                </el-aside>
                <el-main style="background-color: aquamarine">
                    <el-row>
                        <el-button icon="el-icon-search" circle></el-button>
                        <el-button type="primary" icon="el-icon-edit" circle></el-button>
                        <el-button type="success" icon="el-icon-check" circle></el-button>
                        <el-button type="info" icon="el-icon-message" circle></el-button>
                        <el-button type="warning" icon="el-icon-star-off" circle></el-button>
                        <el-button type="danger" icon="el-icon-delete" circle></el-button>
                    </el-row>
                    <el-row>
                        <el-form :model="formData" ref="formData" :rules="rules" label-position="right">
                            <el-form-item label="日期" prop="date">
                                <el-date-picker type="monthrange" v-model="formData.date">

                                </el-date-picker>
                            </el-form-item>
                            <el-form-item label="活动名称" prop="name">
                                <el-input v-model="formData.name"></el-input>
                            </el-form-item>
                            <el-form-item>
                                <el-button @click="submitForm('formData')"></el-button>
                            </el-form-item>
                        </el-form>
                    </el-row>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<script>
    export default {
        name: "Sub",
        data() {
            return {
                formData: {
                    name: "",
                    date: "",
                },
                rules: {
                    name: [{required: true, trigger: 'change',message:'名字不为空'}],
                    date: [{required: true, trigger: 'change',message:'日期不为空'}],
                },
                radio: 6,
                loading:true,
            }
        },
        methods:{
            submitForm(formName) {
                this.$refs[formName].validate((valid) => {
                    console.log(valid)
                    if (valid) {
                        alert('submit!');
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
        }
    };
</script>

<style scoped>
    body {
        margin: 0;
    }
</style>